def add(a ,b ,c ,d):
    return a+b+c+d

def addList(nums):
    add = 0
    for num in nums:
        add += num
    return add

def printMul(max):
    i = 1
    while True:
        j = i
        while True:
            if i * j >= 10:
                if i < 10 and j < 10:
                    print(i , ' *' , j , ' =' , i * j , end='')
                elif i < 10 and j >= 10:
                    print(i , ' *' , j + '=' , i * j , end='')
                elif i >= 10 and j < 10:
                    print(i , '*' , j , ' =' , i * j , end='')
                else:
                    print(i , '*' + j , '=' + i * j , end='')
            if i * j < 10:
                if i < 10 and j < 10:
                    print(i , ' *' , j , ' = ' , i * j , end='')
                elif i < 10 and j >= 10:
                    print(i , ' *' , j , '= ' , i * j , end='')
                elif i >= 10 and j < 10:
                    print(i , '*' , j , ' = ' , i * j , end='')
                else:
                    print(i , '*' , j , '= ' , i * j , end='')
            j = j + 1
            print('      ' , end='')
            if j > max:
                print()
                break
        i = i + 1
        if i > max:
            break

def theNum(nums ,index):
    if index > len(nums) or index < 0:
        return -1
    else:
        return nums[index]

def sumNums(max):
    if max > 1:
        re = max + sumNums(max - 1)
        return re
    else:
        return 1

class Gs(object):
    def __init__(self):
        self.csDepartment =  ['小明','小张','小黄','小杨']
        self.yfDepartment =  ['小黄','小李','小王','小杨','小周']
        self.scDepartment =  ['小杨','小张','小吴','小冯','小周']
        self.quanbu = []
        self.quanbu.extend(self.csDepartment)
        self.quanbu.extend(self.yfDepartment)
        self.quanbu.extend(self.scDepartment)
        self.quanbu = list(set(self.quanbu))
        self.emps = {}
        for i in [self.csDepartment ,self.yfDepartment ,self.scDepartment]:
            for j in i:
                if self.emps.get(j ,4) == 4:
                    self.emps[j] = 1
                else:
                    self.emps[j] = self.emps.get(j) + 1
        print(self.emps)


    def maxEmp(self):
        return len(self.quanbu)

    def danduEmp(self):
        theEmps = []
        for k,v in self.emps.items():
            if v == 1:
                theEmps.append(k)
        return theEmps

    def duoEmp(self):
        theEmps = []
        for k,v in self.emps.items():
            if v != 1:
                theEmps.append(k)
        return theEmps


print(add(1, 2, 9, 4))
print(addList([3,5,8,3,9]))
printMul(9)
print(theNum([2,8,9,7] ,2))
print(sumNums(4))
print()
print()
gs = Gs()
print(gs.maxEmp())
print(gs.danduEmp())
print(gs.duoEmp())
